package com.example.app.yidu.activity.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TableLayout;
import android.widget.TextView;

import com.example.app.yidu.R;
import com.example.app.yidu.activity.adapter.FbTopFgmAdapter;

/**
 * Created by Administrator on 2016/12/14.
 */

public class FbFragment extends Fragment {
    private View view;
    private Toolbar toolbar;
    private TabLayout fb_fragment_tl;
    private ViewPager fb_fragment_vp;


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view=inflater.inflate(R.layout.fragment_fb,container,false);
        fb_fragment_tl= (TabLayout) view.findViewById(R.id.fb_fragment_tl);
        fb_fragment_vp= (ViewPager) view.findViewById(R.id.fb_fragment_vp);
        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        toolbar= (Toolbar) getActivity().findViewById(R.id.toolbar);
        toolbar.setTitle("发布");
        toolbar.setTitleTextColor(getResources().getColor(R.color.white));
        toolbar.setLogo(R.mipmap.ic_launcher);

        FbTopFgmAdapter adapter=new FbTopFgmAdapter(getChildFragmentManager(),getActivity());
        fb_fragment_vp.setAdapter(adapter);
        fb_fragment_tl.setupWithViewPager(fb_fragment_vp);
    }


}
